package com.cryptape.cita_wallet.constant.url;

import com.cryptape.cita_wallet.constant.ConstantUtil;
import com.cryptape.cita_wallet.util.ether.EtherUtil;

/**
 * Created by duanyytop on 2018/8/6
 */
public class HttpUrls {

    // setting module's url list
    public static final String SOURCE_CODE_GITHUB_URL = "https://github.com/cryptape/neuron-android";
    public static final String PRODUCT_AGREEMENT_URL = "https://docs.nervos.org/cyton-android/#/product-agreement";
    public static final String NERVOS_WEB_URL = "https://www.nervos.org/";
    public static final String OPEN_SEA_URL = "https://opensea.io/";
    public static final String INFURA_URL = "https://infura.io/";
    public static final String CITAHUB_TALK_URL = "https://talk.citahub.com/";
    public static final String PECKSHEILD_URL = "https://peckshield.com/";
    public static final String CITA_GITHUB_URL = "https://github.com/cryptape/cita";

    // Discover page config information
    public static final String DISCOVER_URL = "https://dapp.cryptape.com";

    //Token Currency ID Price
    public static final String TOKEN_ID = "https://api.coinmarketcap.com/v2/listings/";
    public static final String TOKEN_CURRENCY = "https://api.coinmarketcap.com/v2/ticker/@ID/?convert=@Currency";
    public static final String COLLECTION_LIST_URL = "https://api.opensea.io/api/v1/assets/?owner=";

    private static final String MANGOASSOCIATION_URL = "https://api.mgpchain.com/user/content";
    private static final String MANGONODE_URL = "https://api.mgpchain.com/user/node";
    private static final String CHIBI_URL = "https://api.mgpchain.com/user/order";

    private static final String MANGOASSOCIATION_URL_TEST = "https://api.coom.pub/user/content";
    private static final String MANGONODE_URL_TEST = "https://api.coom.pub/user/node";
    private static final String CHIBI_URL_TEST = "https://api.coom.pub/user/order";

    private static final String MY_HMIO_ORDERS_TEST = "https://api.coom.pub/order/myHMioOrders";
    private static final String MINING_ORDER_INCOME_TEST = "https://api.coom.pub/order/miningOrderIncome";
    private static final String WITHDRAW_MINER_INCOME_TEST = "https://api.coom.pub/order/withdraw/addOrder";
    private static final String WITHDRAW_MINER_INCOME_INDEX_TEST = "https://api.coom.pub/order/withdraw/withdrawIndex";


    private static final String MY_HMIO_ORDERS = "https://api.mgpchain.com/order/myHMioOrders";
    private static final String MINING_ORDER_INCOME = "https://api.mgpchain.com/order/miningOrderIncome";
    private static final String WITHDRAW_MINER_INCOME = "https://api.mgpchain.com/order/withdraw/addOrder";
    private static final String WITHDRAW_MINER_INCOME_INDEX = "https://api.mgpchain.com/order/withdraw/withdrawIndex";

    public static String getMyHMIOOrders(){
        if (EtherUtil.getEthNodeName().equals(ConstantUtil.ETH_ROPSTEN_NAME)){
            return MY_HMIO_ORDERS_TEST;
        }
        return MY_HMIO_ORDERS;
    }

    public static String getMiningOrderIncome(){
        if (EtherUtil.getEthNodeName().equals(ConstantUtil.ETH_ROPSTEN_NAME)){
            return MINING_ORDER_INCOME_TEST;
        }
        return MINING_ORDER_INCOME;
    }

    public static String getMiningOrderIncomeIndex(){
        if (EtherUtil.getEthNodeName().equals(ConstantUtil.ETH_ROPSTEN_NAME)){
            return WITHDRAW_MINER_INCOME_INDEX_TEST;
        }
        return WITHDRAW_MINER_INCOME_INDEX;
    }


    public static String getWithdrawMinerIncome(){
        if (EtherUtil.getEthNodeName().equals(ConstantUtil.ETH_ROPSTEN_NAME)){
            return WITHDRAW_MINER_INCOME_TEST;
        }
        return WITHDRAW_MINER_INCOME;
    }


    public static String getMangoassociationUrl(){
        if (EtherUtil.getEthNodeName().equals(ConstantUtil.ETH_ROPSTEN_NAME)){
            return MANGOASSOCIATION_URL_TEST;
        }
        return MANGOASSOCIATION_URL;
    }

    public static String getMangonodeUrl(){
        if (EtherUtil.getEthNodeName().equals(ConstantUtil.ETH_ROPSTEN_NAME)){
            return MANGONODE_URL_TEST;
        }
        return MANGONODE_URL;
    }

    public static String getChibiUrl(){
        if (EtherUtil.getEthNodeName().equals(ConstantUtil.ETH_ROPSTEN_NAME)){
            return CHIBI_URL_TEST;
        }
        return CHIBI_URL;
    }

    public static final String VERSION_URL = "https://api.mgpchain.com/api/appVersion/getVersion";

    // Image url
    public static final String DEFAULT_WEB_IMAGE_URL = "https://cdn.cryptape.com/neuron/default_web_icon.png";

    //Token Describe
    public static final String TOKEN_LOGO = "https://github.com/consenlabs/token-profile/blob/master/images/%s.png?raw=true";
    public static final String TOKEN_DESC = "https://raw.githubusercontent.com/consenlabs/token-profile/master/erc20/%s.json";
    public static final String TOKEN_ERC20_DETAIL = "https://ntp.staging.cryptape.com?token=%s";
    public static final String TOKEN_DETAIL = "https://ntp.cryptape.com?coin=%s";

    //Eth Transaction Detail
    public static final String ETH_MAINNET_TRANSACTION_DETAIL = "https://etherscan.io/tx/%s";
    public static final String ETH_MAINNET_CN_TRANSACTION_DETAIL = "https://cn.etherscan.com/tx/%s";
    public static final String ETH_RINKEBY_TRANSACTION_DETAIL = "https://rinkeby.etherscan.io/tx/%s";
    public static final String ETH_ROPSTEN_TRANSACTION_DETAIL = "https://ropsten.etherscan.io/tx/%s";
    public static final String ETH_KOVAN_TRANSACTION_DETAIL = "https://kovan.etherscan.io/tx/%s";

    //CITA Transaction Detail
    public static final String CITA_TEST_TRANSACTION_DETAIL = "http://microscope.cryptape.com/#/transaction/%s";
}
